/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { PureComponent } from "react";
import PageHeaderLayout from "@/layouts/PageHeaderLayout";
import StandardTab from "@/components/StandardTab";
import { connect } from "dva";
import Blacklist from "./blacklist";
import Complaint from "./Complaint";
import BlacklistScan from "./BlacklistScan";
import styles from "./style.less";

@connect(({ user, list }) => ({
  list,
  userInfo: user.currentUser.user_info,
}))
export default class List extends PureComponent {
  state = {
    activeKey: "Complaint",
  };

  onTabChange = activeKey => {
    this.setState({
      activeKey,
    });
  };

  render() {
    const { activeKey } = this.state;

    const panes = [
      {
        tab: "下属驿站投诉管理",
        key: "Complaint",
        component: <Complaint />,
      },
      {
        tab: "黑名单管理",
        key: "Blacklist",
        component: <Blacklist />,
      },
      {
        tab: "黑名单扫描纪录",
        key: "BlacklistScanRecord",
        component: <BlacklistScan />,
      },
    ];
    return (
      <PageHeaderLayout title="投诉与黑名单">
        <div className={styles.main}>
          <div style={{ paddingBottom: "24px" }}>
            <StandardTab
              style={{ marginBottom: 24 }}
              onChange={this.onTabChange}
              activeKey={activeKey}
              name="complaint"
              panes={panes}
            />
          </div>
        </div>
      </PageHeaderLayout>
    );
  }
}
